<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Dokument</title>
		<link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="/static/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" type="text/css" href="/static/css/custom.css" />
		<script src="/static/js/bootstrap.min.js"></script>
	</head>
	<body>
		<div id="box">
			<div class="navbar">
				<div class="navbar-inner">
					<div class="container">
 						<a class="brand" href="/"><strong>Repozytorium</strong></a>
 					</div>
				</div>
			</div>
			<form action="update" class="form-horizontal well">
				<div class="control-group">
					<label class="control-label"><strong>Nazwa pliku:</strong></label>
					<div class="controls">
						<div class="input-append">
							<span class="input-large uneditable-input">${document.filename}</span>
							<span class="add-on"><i class="icon-file"></i></span>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><strong>Format:</strong></label>
					<div class="controls">
						<div class="input-append">
							<span class="input-small uneditable-input">${document.format}</span>
							<span class="add-on"><i class="icon-file"></i></span>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><strong>Tytuł:</strong></label>
					<div class="controls">
						<div class="input-append">
							<input class="input-large" name="title" type="text" value="${document.title}">
							<span class="add-on"><i class="icon-book"></i></span>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><strong>Autor:</strong></label>
					<div class="controls">
						<div class="input-append">
							<input class="input-large" name="author" type="text" value="${document.author}">
							<span class="add-on"><i class="icon-user"></i></span>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><strong>Data utworzenia:</strong></label>
					<div class="controls">
						<div class="input-append">
							<input class="input-small" name="created" type="date" value="${document.created}" placeholder="rrrr-mm-dd">
							<span class="add-on"><i class="icon-calendar"></i></span>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><strong>Data dodania:</strong></label>
					<div class="controls">
						<div class="input-append">
							<span class="input-small uneditable-input">${document.added}</span>
							<span class="add-on"><i class="icon-calendar"></i></span>
						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<button class="btn btn-medium btn-primary" type="submit">Aktualizuj</button>
					</div>
				</div>
			</form>
			
			<c:if test="${not empty terms}">
				<div class="well">
					<strong>Najczęściej występujące frazy w tym dokumencie: </strong>
					<c:forEach var="term" items="${terms}">
						<s:url var="url" value="/documents" >
							<s:param name="q">${term}</s:param>
						</s:url>
						<a href="${url}">${term}</a>
					</c:forEach>
				</div>
			</c:if>
			
			<%@ include file="Messages.jsp" %>
		</div>

	</body>
</html>